﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace KWT.DRG_DIP.API.Migrations
{
    /// <inheritdoc />
    public partial class _20250423142132 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "DRG_Code",
                table: "Sys_List");

            migrationBuilder.DropColumn(
                name: "DRG_Name",
                table: "Sys_List");

            migrationBuilder.AddColumn<string>(
                name: "Assist_Code",
                table: "Sys_List",
                type: "varchar(256)",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "DIP 辅助目录 编码")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Assist_Name",
                table: "Sys_List",
                type: "varchar(256)",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "DIP 辅助目录 名称")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Assist_Type",
                table: "Sys_List",
                type: "varchar(256)",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "DIP 辅助目录 类别")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Group_Code",
                table: "Sys_List",
                type: "varchar(256)",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "分组编码:DRG:DRG编码；DIP：病种编码")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Group_Name",
                table: "Sys_List",
                type: "varchar(256)",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "分组名称:DRG:DRG名称；DIP：病种名称")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Suggest_Json",
                table: "List_Suggest",
                type: "text",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "",
                oldClrType: typeof(string),
                oldType: "varchar(4000)",
                oldMaxLength: 4000,
                oldComment: "")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "QC_Json",
                table: "List_Suggest",
                type: "text",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "",
                oldClrType: typeof(string),
                oldType: "varchar(4000)",
                oldMaxLength: 4000,
                oldComment: "")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Diagnoset_Json",
                table: "List_Suggest",
                type: "text",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "GroupInfo_Json",
                table: "List_Suggest",
                type: "text",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Operation_Json",
                table: "List_Suggest",
                type: "text",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Assist_Code",
                table: "Sys_List");

            migrationBuilder.DropColumn(
                name: "Assist_Name",
                table: "Sys_List");

            migrationBuilder.DropColumn(
                name: "Assist_Type",
                table: "Sys_List");

            migrationBuilder.DropColumn(
                name: "Group_Code",
                table: "Sys_List");

            migrationBuilder.DropColumn(
                name: "Group_Name",
                table: "Sys_List");

            migrationBuilder.DropColumn(
                name: "Diagnoset_Json",
                table: "List_Suggest");

            migrationBuilder.DropColumn(
                name: "GroupInfo_Json",
                table: "List_Suggest");

            migrationBuilder.DropColumn(
                name: "Operation_Json",
                table: "List_Suggest");

            migrationBuilder.AddColumn<string>(
                name: "DRG_Code",
                table: "Sys_List",
                type: "varchar(256)",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "DRG编码")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "DRG_Name",
                table: "Sys_List",
                type: "varchar(256)",
                maxLength: 256,
                nullable: false,
                defaultValue: "",
                comment: "DRG名称")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "Suggest_Json",
                table: "List_Suggest",
                type: "varchar(4000)",
                maxLength: 4000,
                nullable: false,
                comment: "",
                oldClrType: typeof(string),
                oldType: "text",
                oldMaxLength: 256,
                oldDefaultValue: "",
                oldComment: "")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<string>(
                name: "QC_Json",
                table: "List_Suggest",
                type: "varchar(4000)",
                maxLength: 4000,
                nullable: false,
                comment: "",
                oldClrType: typeof(string),
                oldType: "text",
                oldMaxLength: 256,
                oldDefaultValue: "",
                oldComment: "")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");
        }
    }
}
